import request from "@/utils/request";

export function addNewSociety(societyName) {
  let creationTime = Date.now();
  return request({
    url: `/api/society/add`,
    method: 'post',
    data: {
      title: societyName,
      creationTime
    }
  })
}

export function getAllSociety(pageNo, limit) {
  return request({
    url: `/api/society/getInfo`,
    method: 'get',
    params: {pageNo, limit}
  })
}

export function getSocietyMembers(data) {
  return request({
    url: `/api/society/member/info`,
    method: 'get',
    params: data
  })
}

export function upMemberSociety(user_id) {
  return request({
    url: `/api/society/quit`,
    method: 'get',
    params: {user_id}
  })
}

// ids id数组，用于删除多个或单个社团
export function delSociety(ids) {
  return request({
    url: `/api/society/delete`,
    method: 'post',
    data: {ids}
  })
}